<?php
/**
* File that sets view of buslines page.
* @package busmap
*/
?>
<h3>Bussiliinid</h3>
<?php if(count($this->entries)){ ?>
	<table class="data-listing" cellpadding=0 cellspacing=0>
		<tr>
			<th>Nimi / kirjeldus</th>
			<th>Peatused</th>
		</tr>
		<?php foreach ($this->entries as $entry): ?>
		<tr>	    
			<td style="border-bottom:1px solid black;vertical-align:top;">
				<div class="element-name"><?php echo $this->escape($entry->name) ?></div>
				<div class="element-description"><?php echo $this->escape($entry->description) ?></div>
			</td>
			<td style="border-bottom:1px solid black;">
			<?php 
				if(count($entry->busstops)){
					foreach($entry->busstops as $busstopData){
						list($busstop, $key) = $busstopData;
						echo '<div class="element-name orange">'.$busstop->name.'</div>';
					}
				}else{
					echo '<div class="element-name orange">-</div>';
				}
			?>
			</td>
		</tr>
	    <?php endforeach ?>
	</table>
<?php }else{ ?>
	Hetkel bussiliinid puuduvad andmebaasis.
<?php } ?>